package com.simple.mybaits.simplemybatis;

import com.simple.mybaits.simplemybatis.entity.User;
import com.simple.mybaits.simplemybatis.mapper.UserMapper;
import com.simple.mybaits.simplemybatis.session.SqlSession;
import com.simple.mybaits.simplemybatis.session.SqlsessionFactory;
import org.junit.jupiter.api.Test;

import java.util.List;

//@RunWith(SpringRunner.class)
//@SpringBootTest
public class SimpleMybatisApplicationTests {

//    @Test
////  public void contextLoads() {
////
    /**
     * Test
     */
    @Test
    public void test(){
        SqlsessionFactory sqlsessionFactory = new SqlsessionFactory();

        SqlSession session = sqlsessionFactory.build();

        UserMapper userMapper = session.getMapper(UserMapper.class);

        List<User> userList = userMapper.selectList();

        System.out.println(userList);
    }

}
